<?php
namespace Plugin\Alarm\Schema;

use Plugin\Alarm\Model\RdAlarmWarnRecord;
use Hyperf\Swagger\Annotation\Property;
use Hyperf\Swagger\Annotation\Schema;

/**
 * 报警记录
 */
#[Schema(title: 'RdAlarmWarnRecordSchema')]
class RdAlarmWarnRecordSchema implements \JsonSerializable
{
    #[Property(property: 'id', title: 'id', type: 'bigint')]
    public string $id;

    #[Property(property: 'broadcast_id', title: '广播id', type: 'int')]
    public string $broadcast_id;

    #[Property(property: 'msg_id', title: '消息id', type: 'int')]
    public string $msg_id;

    #[Property(property: 'rod_id', title: '装置id', type: 'int')]
    public string $rod_id;

    #[Property(property: 'stand_id', title: '站点id', type: 'int')]
    public string $stand_id;

    #[Property(property: 'type', title: '事件id', type: 'int')]
    public string $type;

    #[Property(property: 'work_id', title: '工单id', type: 'tinyint')]
    public string $work_id;

    #[Property(property: 'warning_time', title: '报警时间', type: 'timestamp')]
    public string $warning_time;

    #[Property(property: 'device_id', title: '报警设备id', type: 'bigint')]
    public string $device_id;
    
    #[Property(property: 'risk_level', title: '风险等级', type: 'tinyint')]
    public string $risk_level;
    
    #[Property(property: 'title', title: '标题', type: 'string')]
    public string $title;
    
    #[Property(property: 'content', title: '内容', type: 'string')]
    public string $content;
    
    #[Property(property: 'msg_type', title: '消息类型1雷达2相机', type: 'tinyint')]
    public string $msg_type;

    #[Property(property: 'created_at', title: 'created_at', type: 'timestamp')]
    public string $created_at;

    #[Property(property: 'updated_at', title: 'updated_at', type: 'timestamp')]
    public string $updated_at;





    public function __construct(RdAlarmWarnRecord $model)
    {
       $this->id = $model->id;
       $this->broadcast_id = $model->broadcast_id;
       $this->msg_id = $model->msg_id;
       $this->rod_id = $model->rod_id;
       $this->stand_id = $model->stand_id;
       $this->type = $model->type;
       $this->work_id = $model->work_id;
       $this->warning_time = $model->warning_time;
       $this->device_id = $model->device_id;
       $this->risk_level = $model->risk_level;
       $this->title = $model->title;
       $this->content = $model->content;
       $this->msg_type = $model->msg_type;
       $this->created_at = $model->created_at;
       $this->updated_at = $model->updated_at;

    }

    public function jsonSerialize(): array
    {
        return ['id' => $this->id ,'broadcast_id' => $this->broadcast_id ,'msg_id' => $this->msg_id ,'rod_id' => $this->rod_id ,'stand_id' => $this->stand_id ,'type' => $this->type ,'work_id' => $this->work_id ,'warning_time' => $this->warning_time ,'device_id' => $this->device_id ,'risk_level' => $this->risk_level ,'title' => $this->title ,'content' => $this->content ,'msg_type' => $this->msg_type ,'created_at' => $this->created_at ,'updated_at' => $this->updated_at];
    }
}